import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path:"/",
    redirect: "/layout"
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import(/* webpackChunkName: "Search" */ '../views/Search')
  },
  {
    path: '/layout',
    name: 'Layout',
    component: () => import(/* webpackChunkName: "Layout" */ '../views/Layout'),
    children:[
      // {
      //   path:"/layout",
      //   redirect:"/layout/home" 
      // },
      {
        path: '/layout/home',
        name: 'Home',
        component: () => import(/* webpackChunkName: "Home" */ '../views/Layout/Children/Home')
      },
      {
        path: '/layout/pigeonhole',
        name: 'Pigeonhole',
        component: () => import(/* webpackChunkName: "Pigeonhole" */ '../views/Layout/Children/Pigeonhole')
      },
      {
        path: '/layout/knowledge',
        name: 'Knowledge',
        component: () => import(/* webpackChunkName: "Knowledge" */ '../views/Layout/Children/Knowledge')
      },
      {
        path: '/layout/article',
        name: 'Article',
        component: () => import(/* webpackChunkName: "Article" */ '../views/Layout/Children/Article')
      },
      {
        path: '/layout/classify/:id',
        name: 'Classify',
        component: () => import(/* webpackChunkName: "Classify" */ '../views/Layout/Children/Classify')
      },
      {
        path: '/layout/tag',
        name: 'Tag',
        component: () => import(/* webpackChunkName: "Tag" */ '../views/Layout/Children/Tag')
      },
      {
        path: '/layout/page/:id',
        name: 'Page',
        component: () => import(/* webpackChunkName: "Page" */ '../views/Layout/Children/Page'),
      },
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
